unit UMoledoNotalFiscal;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UFomCadastro, DBClient, Provider, DB, DBTables, Menus, StdCtrls,
  ComCtrls, DBCtrls, Buttons, Grids, DBGrids, ExtCtrls, Mask;

type
  TFMoledoNotalFiscal = class(TFormCadastro)
    edCodigo: TDBEdit;
    Label25: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    cdsCadastroMOD_CODIGO: TIntegerField;
    cdsCadastroMOD_DESC: TStringField;
    cdsCadastroMOD_COD_MODELO: TStringField;
    cdsCadastroMOD_MODELO: TStringField;
    cdsCadastroDATAMODIFICACAO: TDateTimeField;
    cdsCadastroUSUARIO_CADASTRO: TStringField;
    cdsCadastroDATA_CADASTRO: TDateTimeField;
    cdsCadastroDATA_EXCLUSAO: TDateTimeField;
    cdsCadastroDATA_AUTERACAO: TDateTimeField;
    cdsCadastroEXCLUIDO: TStringField;
    cdsCadastroUSUARIO_RECUPERACAO: TStringField;
    cdsCadastroDATA_RECUPERACAO: TDateTimeField;
    cdsCadastroCODIGOEMPRESA: TIntegerField;
    cdsCadastroDATA_REPLICACAO: TDateTimeField;
    cdsCadastroUSUARIO: TStringField;
    cdsCadastroUSUARIO_AUTERACAO: TStringField;
    cdsCadastroUSUARIO_EXCLUSAO: TStringField;
    procedure BtnIncluirClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FMoledoNotalFiscal: TFMoledoNotalFiscal;

implementation

uses UGeral, PesquisaLocalEstoque;

{$R *.dfm}

procedure TFMoledoNotalFiscal.BtnIncluirClick(Sender: TObject);
begin
  inherited;
  dsCadastro.DataSet.FieldByName('MOD_CODIGO').AsInteger := Retorna_Codigo_Generetor('GEN_MODELO_NOTAFISCAL');
end;

procedure TFMoledoNotalFiscal.FormCreate(Sender: TObject);
begin

  QCadastro.SQl.Clear;
  QCadastro.SQl.Add('SELECT * FROM MODELO_NOTAFISCAL');
  inherited;

end;

procedure TFMoledoNotalFiscal.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin              
  FMoledoNotalFiscal:=nil;
  inherited;
end;

end.
